import React,{Component} from 'react'
import {HashRouter,Route,Switch} from 'react-router-dom'
import Home from './../router/home'
import About from './about'
import Topic from './topic'
import IRouter from './../router2/IRouter'
import AboutA from './aboutA'
import AboutB from './aboutB'
import Info from './info'
import NoMatch from './NoMatch'

export default class Router extends Component {
    render(){
        return (
            <HashRouter>
                <IRouter>
                    <Switch>
                        <Route exact path="/"  component={Home}></Route>
                        <Route path="/topic"  render={()=>
                            <Topic>
                                <Route path="/topic/:id"  component={Info}></Route>
                            </Topic>
                        }></Route>
                        <Route path="/about"  render={(match) =>
                            <About>
                                <Route path="/about/a"  component={AboutA}></Route>
                                <Route path="/about/b"  component={AboutB}></Route>
                            </About>
                        }></Route>
                        <Route component={NoMatch}></Route>
                    </Switch   >
                </IRouter>
            </HashRouter>
        )
    }
}